﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnRegister_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            bool registration = FifaGamer.Register.Register_User(txtFirstname.Text, txtLastname.Text, txtUsername.Text, txtEmail.Text, default(DateTime?), ddlConsole.Text, txtConsoleUsername.Text,
                txtPhone.Text, chkWhatsApp.Checked, ddlSkill.Text);

            if (registration)
            {
                Response.Redirect("./Default.aspx");
            }
            else
            {
                divError.Visible = true;
                altError.Text = "An error has occured during registration";
            }
        }
    }
}